package com.app.ytong.bean;

import android.text.TextUtils;

import com.alibaba.fastjson.annotation.JSONField;
import com.app.ytong.util.UHFUtil;

import java.util.ArrayList;

public class BaseListData extends BasisBean {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String id;
	private String name;
	private String appid;
	private String authkey;
	private String gatherTime;
	private int status;
	private String alarm;
	private String dataId;

	private String no = "";

	private boolean isCheck = false;
	private int resid = -1;
	private int resBg = -1;

	private boolean isOut = false;

	private ArrayList<String> urlList;

	public BaseListData() {
	}
	public BaseListData(String id, String name) {
		this.id = id;
		this.name = TextUtils.isEmpty(name)?"":""+name;
	}
	public BaseListData(String id, ArrayList<String> urlList) {
		this.id = id;
		this.urlList = urlList;
	}

	public BaseListData(String id, String name,String no) {
		this.id = id;
		this.name = TextUtils.isEmpty(name)?"":""+name;
		this.no = no;
	}

	public BaseListData(String id, String name, int resid, int resBg) {
		this.id = id;
		this.name = name;
		this.resid = resid;
		this.resBg = resBg;
	}

	public BaseListData(String name, int resBg) {
		this.name = name;
		this.resBg = resBg;
	}

//	public BaseListData( String name, int resBg) {
//		this.name = name;
//		this.resBg = resBg;
//	}

	public String getId() {
		return id;
	}

	@JSONField(serialize = false)
	public int getId_INT() {
		if(TextUtils.isEmpty(id))return 0;
		try {
			return  Integer.valueOf(id);
		}catch (Exception e){

		}
		return 0;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		if(name== null){
			return "";
		}
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getResid() {
		return resid;
	}

	public void setResid(int resid) {
		this.resid = resid;
	}

    public int getResBg() {
        return resBg;
    }

    public void setResBg(int resBg) {
        this.resBg = resBg;
    }

	public String getAppid() {
		return appid;
	}

	public void setAppid(String appid) {
		this.appid = appid;
	}

	public String getAuthkey() {
		return authkey;
	}

	public void setAuthkey(String authkey) {
		this.authkey = authkey;
	}

	public boolean isCheck() {
		return isCheck;
	}

	public void setCheck(boolean check) {
		isCheck = check;
	}

	public String getGatherTime() {
		return gatherTime;
	}

	public void setGatherTime(String gatherTime) {
		this.gatherTime = gatherTime;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getAlarm() {
		return alarm;
	}

	public void setAlarm(String alarm) {
		this.alarm = alarm;
	}

	public String getDataId() {
		return dataId;
	}

	public void setDataId(String dataId) {
		this.dataId = dataId;
	}

	public boolean isOut() {
		return isOut;
	}

	public void setOut(boolean out) {
		isOut = out;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	public ArrayList<String> getUrlList() {
		return urlList;
	}

	public void setUrlList(ArrayList<String> urlList) {
		this.urlList = urlList;
	}

	public int getPath(){
		switch (id){
			case "0":
				if(UHFUtil.getStatus()){
					return resid;
				}else {
					return resBg;
				}
			default:
				return resid;
		}
	}
}
